package com.wedo.mall.activity.user;

import android.os.Bundle;
import android.widget.TextView;

import com.e.library.activity.EActivity;
import com.e.library.entity.User;
import com.e.library.http.EApi;
import com.e.library.utils.EViewUtils;
import com.jcodecraeer.xrecyclerview.XRecyclerView;
import com.wedo.mall.R;
import com.wedo.mall.adapter.ContactAdapter;
import com.wedo.mall.ptr.Pull2Refresh;

import butterknife.BindView;

public class ContactActivity extends EActivity {

    @BindView(R.id.tv_empty) TextView tv_empty;
    @BindView(R.id.rv_list) XRecyclerView rv_list;
    private ContactAdapter mAdapter;

    private Pull2Refresh<User> ptr;

    @Override
    protected int layout() {
        return R.layout.activity_contact;
    }

    @Override
    protected void onActivityCreated(Bundle state) {
        rv_list.setHasFixedSize(true);
        EViewUtils.vertical(rv_list);

        ptr = new Pull2Refresh<>();
        mAdapter = new ContactAdapter(this,null);
        mAdapter.listener(this);
        ptr.widget(rv_list).adapter(mAdapter).url(EApi.USER_ADDRESSLIST).clazz(User.class).emptyWidget(tv_empty).done();
    }

}
